<?php
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\helpers\Html;
use yii\widgets\Pjax;
?>
<?php Pjax::begin() ?>
<?php $form = ActiveForm::begin([
        'action' => Url::to(['express', 'id' => $model->id]),
        'id' => 'OrderStore',
        'layout' => 'horizontal',
        'enableClientValidation' => true,
        'enableAjaxValidation' => true,
        'errorSummaryCssClass' => 'error-summary alert alert-danger',
        'fieldConfig' => [
            'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
            'horizontalCssClasses' => [
                'label' => 'col-sm-2',
                #'offset' => 'col-sm-offset-4',
                'wrapper' => 'col-sm-8',
                'error' => '',
                'hint' => '',
            ],
        ],
    ]
);
?>

<?php echo $form->errorSummary($model); ?>

    <!-- attribute express_code -->
<?php
$express = \yiike\order\model\Express::find()->select(['id', 'name'])->asArray('code')->all();
$express = \yii\helpers\ArrayHelper::map($express, 'id', 'name');
echo  $form->field($model, 'express_code')->label('物流公司')->dropDownList($express)
?>

    <!-- attribute express_no -->
<?= $form->field($model, 'express_no')->textInput(['maxlength' => true]) ?>

    <div class="col-lg-offset-2">
        <?= Html::submitButton(
            '<span class="glyphicon glyphicon-check"></span> ' .
            ($model->isNewRecord ? '保存' : '保存'),
            [
                'id' => 'save-' . $model->formName(),
                'class' => 'btn btn-primary'
            ]
        );
        ?>
    </div>
<?php ActiveForm::end(); ?>
<?php Pjax::end(); ?>
